1. Field of the Invention
The present invention relates to managing Transmission Control Protocol (TCP) connections in an embedded system, and more particularly, to managing TCP connections in an embedded system, where TCP connections established between software blocks executed in the embedded system are monitored and managed.
2. Description of the Related Art
An embedded system is a system where a unit group includes a plurality of processors according to a specific need, and each of the processors provides services aimed at the corresponding group by cooperating functions with one another. That is, the embedded system needs connections between software (S/W) blocks operating in each of the processors for the cooperation to achieve the object. Also, a disconnection or abnormal operation between specific S/W blocks can have an effect on the functions of other S/W blocks in the embedded system. Thus, there is a need for detecting whether there is an abnormal operation of a connection and for closing the abnormal connection.
In a network system, a plurality of S/W blocks are interlocked and operate with one another, and a plurality of methods such as a shared memory, a Message Queue, a TCP/UDP (User Datagram Protocol)/IP (Internet Protocol) are used in order to communicate between the S/W blocks. The shared memory or the Message Queue are used to effect communication between the S/W blocks operating in the same hardware (H/W) block, and the TCP/UDP/IP is used to effect communication between S/W blocks operating in separate H/W blocks. In particular, the TCP/IP is frequently used to effect communication between H/W blocks in an embedded system comprising a plurality of H/W blocks such as a large-scale network system. This is due to the TCP more reliably confirming whether packets were transmitted and re-transmitting the packets that were not transmitted as compared to the UDP. The high reliability communication services provided by the TCP forwards data transmitted from a higher layer of the transmission side to a higher layer of the reception side in perfect form.
The TCP/IP was devised to support reliable communication in a network. However, the TCP/IP is not a polling protocol. A polling protocol has a transmission control scheme to sequentially query whether there is a transmission request, to generate an instruction to start the transmission to the terminal when there is a request, and to query whether there is a transmission request for the next terminal when there is no request. Accordingly, the TCP does not provide a mechanism to frequently check the state of a connection.
Although a keep-alive timer checks a connection in the TCP, it is not used to determine a state of a peer connection but rather is used to determine a bad peer. The keep-alive timer is used to prevent two TCP from being in an idle state for a long time interval. Assume that a client establishes a TCP connection with a server, transmits data to the server, and does not transmit any more data. The client requested the establishment of the TCP connection, and the server received a request for the establishment of the TCP connection from the client.
When there is an error in the client, the TCP connection between the erroneous client and the server will be maintained forever. In order to obviate such a situation, the keep-alive timer is embodied in most of the servers. Whenever the server receives a segment from the client, the server initializes the timer. The time-termination interval is generally chosen to be two hours. When the server does not receive any segment from the client within the two hour interval, the server transmits a prove to determine whether there is an error. When the server does not receive any response even after it has transmitted 10 prove segments every 75 seconds, the server considers the client to be down and terminates the corresponding TCP connection. Accordingly, when the TCP connection is checked using the keep-alive timer, the system cannot detect an error and close the corresponding TCP connection for a long time after an error occurs in the TCP connection.
Most systems use a method of transmitting and receiving a small message periodically in an application layer as another method of monitoring the TCP connection. The system using this method determines that an error has occurred in this TCP connection when there is no message exchange in a specific TCP connection for a predetermined time interval. This method is more effective than using the keep-alive timer in that the TCP connection error can be rapidly detected.
However, when the method of monitoring the TCP connection in each of the application layers is applied in the embedded system in which many application processes are operating, a large amount of overhead occurs since such a method is embodied in every application that is needed to maintain the connection for the corresponding function and to rapidly detect the connection closing.
In particular, when an event occurs that is applied to all applications in the same manner, for example, turning off of a subsystem, removing a link, removal of an H/W block, the connection between S/W blocks is actually in a state where no data is being transceived, and an effective embedded system can be embodied only by detecting and closing the connection in such a state and performing necessary functions in each of the S/W blocks.
An embedded system can consist of a plurality of H/W blocks. Each H/W block can perform a TCP/IP communication with another H/W block through a TCP/IP kernel. A plurality of S/W blocks are executed in each H/W block, and the S/W blocks are connected to S/W blocks that are executed in another H/W block through the TCP/IP communication. Then, in that case, in order to monitor the TCP connection between the S/W blocks, the message must be exchanged between all of the S/W blocks.
For example, a transmission path of a monitoring message used to monitor the TCP connection between an S/W block of a first H/W block and an S/W block of a second H/W block, is the S/W block of the first H/W block to a TCP/IP kernel of the first H/W block to a TCP/IP kernel of the second H/W block to an S/W block of the second H/W block. Also, a response message is transmitted from the S/W block of the second H/W block to the S/W block of the first H/W block through a reverse path.
In order to monitor the TCP connection using such a method, too much overhead is created since the message must be frequently transmitted through the path described above. Accordingly, there is a need to manage the TCP connection, where there is little overhead and the monitoring is rapidly performed in order to effectively manage an embedded system.